<?php

class Validate {

  public static function check($value, $valids) {
    $result = array();
    foreach ($valids as $class_name => $params) {
      $vl = new $class_name($value, $params);
      if (!$vl->is_valid()) {
        $result[] =  $vl->get_message();
        return $result;
      }
    }
    return true;
  }
}